<template>
  <div>
    <div v-text="content"></div>
     <table border="1">
       <tr v-for="(i,index) in slist">
         <td :class="{on:index%2==0,off:index%2!=0}">
           {{index}}===={{i}}
         </td>
       </tr>
     </table>

  </div>

</template>

<script>
    export default {
        name: "mytest",
      data:function () {
          return{
            content:"你好",
            slist:['李四','王五','张三','五八']
        }

      }
    }
</script>

<style scoped>
  .on{
    background:red;
  }
  .off{
    background: aqua;
  }

</style>
